import axios from "./http.js";
// import _ from "lodash";
/*
底薪
*/
// 获取底薪列表
export function getSalaryList(data, config) {
  let url = "/bs/basic/salary/basicPage";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 新增/修改保底(底薪)
export function addOrUpdateSalary(data, config) {
  let url = "/bs/basic/salary/addOrUpdateSalary";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 获取底薪详情
export function getSalary(options) {
  let url = "/bs/basic/salary/getSalaryDtl";

  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 删除底薪/保底
export function deleteSalary(options) {
  let url = "/bs/basic/salary/deleteSalary";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 根据平台和主播号获取主播
export function getAnchorByNo(options) {
  let url = "/bs/basic/salary/getAnchorByNo";

  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}

/* 刷币相关 */
// 获取易快报更新时间
export function getRefreshTime(options) {
  let url = "/bs/cost/brush/refreshTime";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}

// 新增/修改核销
export function addOrUpdateCheck(data, config) {
  let url = "/bs/cost/brush/addOrUpdateCheck";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 核销项目详情
export function getCheckDetail(data, config) {
  let url = "/bs/cost/brush/checkDetail";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 核销表格模板
export function downrewardMouldExcel(data, config) {
  let url = "/bs/cost/brush/exportTemplateExcel";

  data = data || {};
  config = config || {};
  config.responseType = "blob";
  return axios.post(url, data, config);
}
// 获取刷币列表-财务和运营
export function getRewardList(data, config) {
  let url = "/bs/cost/brush/brushPage";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}

// 财务下载图片表格
export function downPicExcel(data, config) {
  let url = "/bs/cost/brush/exportExcel";

  data = data || {};
  config = config || {};
  config.responseType = "blob";
  return axios.post(url, data, config);
}
// 财务下载数据表格
export function downDataExcel(data, config) {
  let url = "/bs/cost/brush/exportExcel";
  // const opts = _.merge({}, options || {});
  // opts.responseType = "blob";
  // return axios.get(url, opts);
  data = data || {};
  config = config || {};
  config.responseType = "blob";
  return axios.post(url, data, config);
}

/*
财务相关
*/
// 获取部门首页总成本和部门列表
export function getFinalCost(options) {
  let url = "/bs/cost/brush/queryCostOverviewOfDept";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 获取运营首页总成本和部门列表
export function getFinalCostPersonal(options) {
  let url = "/bs/cost/brush/queryCostOverviewOfSingle";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 同步易快报数据到数据库
export function refreshData(options) {
  // let url = "/bs/cost/ekb/syncEkbExcelData";
  let url = "/bs/cost/ekb/refreshEkb/expense";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 获取刷币申请总额详情
export function getRewardTotalList(data, config) {
  let url = "/bs/cost/brush/amountTotalDtl";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 获取刷币申请总额详情列表
export function getRewardCostList(data, config) {
  let url = "/bs/basic/salary/getSalaryDtl";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 获取签约金/设备扶持/住房扶持费用成本详情
export function getEachCostList(options) {
  let url = "/bs/cost/brush/queryCostDetailOfSign";
  const opts = _.merge({}, options || {});

  return axios.get(url, opts);
}
// 运营核销详情列表
export function getRewardDetailIndex(data, config) {
  let url = "/bs/cost/brush/business/checkDetailList";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 运营核销详情
export function getRewardDetail(data, config) {
  let url = "/bs/cost/brush/business/checkDetail";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
export function getCostList(data, config) {
  let url = "/bs/cost/brush/anchorSupportDetail";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
// 获取保底详情列表
export function getBaseCostList(data, config) {
  let url = "/bs/basic/salary/getBasicTotal";
  data = data || {};
  config = config || {};
  return axios.post(url, data, config);
}
